// 图片水印

const path = require("path")
const jimp = require("jimp")

async function main(){
   const filepath = path.resolve(__dirname, "./public/picture/1760159462448-bfesda.jpg")
   const originNme = path.resolve(__dirname, "./public/picture/水印.png")
   const newName = path.resolve(__dirname, "./public/picture/new.png")

   const [water,origin] = await Promise.all([
    jimp.read(filepath),
    jimp.read(originNme)
   ])

   water.composite(origin, 10, 10,{
    mode: jimp.BLEND_SOURCE_OVER,
    opacityDest: 0.3,
   }).write(newName)
}

main()